package com.bbs.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bbs.pojo.Message;
import com.bbs.pojo.dto.MessageDto;

import java.time.LocalDateTime;
import java.util.List;

public interface MessageService extends IService<Message> {
    Long acknowledgedMessageCountByReceiver(String id);

    /**
     * 除用户间私信之外的消息
     * @param receiverId
     * @return
     */
    List<MessageDto> getMessagesByReceiver(String receiverId);

    MessageDto getMessageByIdAndReceiver(String messageId, String receiverId);

    MessageDto getMessageById(String id);

    boolean sendMessage(MessageDto messageDto);

    boolean sendMessage(Message message);

    boolean acknowledgeMessage(String receiverId, List<String> messageIds);

    boolean acknowledgeMessageBefore(String receiverId, LocalDateTime time);

    boolean deleteMessage(MessageDto messageDto);
}
